package action.expert;

import java.util.List;

import persistence.model.TdfkfaDictCity;
import persistence.model.TdfkfaDictExperttype;
import persistence.model.TdfkfaDictProvince;
import presentation.extendmodel.SimpleExpertModel;
import presentation.queryvo.ExpertListQueryVO;
import service.DictInfoService;
import service.ExpertService;

import com.opensymphony.xwork2.ActionSupport;

public class AssignExpertPrepareAction extends ActionSupport {

    private static final long serialVersionUID = 1L;

    private ExpertService expertService;

    private List<SimpleExpertModel> expertList;

    private DictInfoService dictInfoService;

    private List<TdfkfaDictProvince> provinceList;

    private List<TdfkfaDictCity> cityList;

    private List<TdfkfaDictExperttype> typeList;

    private String provinceId;

    private ExpertListQueryVO queryVO;

    public String initPrepare() throws Exception {

        provinceList = dictInfoService.getProvinceList();
        typeList = dictInfoService.getExpertTypeList();
        return SUCCESS;
    }

    public String loadSelectCityList() throws Exception {

        if (provinceId != null && !"".equals(provinceId)) {
            cityList = dictInfoService.getCityList(new Integer(provinceId));
        }
        return SUCCESS;
    }

    public String loadExpertList() throws Exception {

        expertList = expertService.getSimpleExpertList(queryVO);

        return SUCCESS;
    }

    public void setExpertService(ExpertService expertService) {
        this.expertService = expertService;
    }

    public List<SimpleExpertModel> getExpertList() {
        return expertList;
    }

    public List<TdfkfaDictProvince> getProvinceList() {
        return provinceList;
    }

    public List<TdfkfaDictCity> getCityList() {
        return cityList;
    }

    public List<TdfkfaDictExperttype> getTypeList() {
        return typeList;
    }

    public void setProvinceId(String provinceId) {
        this.provinceId = provinceId;
    }

    public ExpertListQueryVO getQueryVO() {
        return queryVO;
    }

    public void setQueryVO(ExpertListQueryVO queryVO) {
        this.queryVO = queryVO;
    }

    public void setDictInfoService(DictInfoService dictInfoService) {
        this.dictInfoService = dictInfoService;
    }

}
